const http = require('http')

const homePage = `
<!doctype html>
<html>
	<head>
		<meta charset='utf-8'>
		<title>Nodejs 部署（随时失效）</title>
		<style lang='css'>
			* {
				padding: 0;
				margin: 0;
			}
			body{
				padding: 30px 0;
				text-align: center;
				font-size: 16px;
				background: #333;
			}
			h1, h2{
				color: #fff;
			}
			nav{
				margin-top: 20px;
			}
			a{
				color: #ccc;
				text-decoration: none;
			}
			a:hover{
				text-decoration: underline;
			}
		</style>
	</head>
	<body>
		<h1>Nodejs 部署</h1>
		<h2>部署实例</h2>
		<nav>
			<ul>
				<li>
					<a href="http://zhibo8.cchris.cc" target='_blank'>zhibo8</a>
				</li>
				<li>
					<a href="/b" target='_blank'>App 后台</a>
				</li>
				<li>
					<a href="/c" target='_blank'>微信小程序后台</a>
				</li>
				<li>
					<a href="/d" target='_blank'>微信公众号后台</a>
				</li>
			</ul>
		</nav>
	</body>
</html>
`

http.createServer((req, res) => {
	res.statusCode = 200
	res.setHeader('Content-Type', 'text/html')
	res.end(homePage)
})
.listen(3010, () => {
	console.log('Server running at 3010')
})